package agentspeak.editors;

import org.eclipse.jface.text.rules.*;
import org.eclipse.jface.text.*;

public class ASLScanner extends RuleBasedScanner {

	public ASLScanner(ColorManager manager) {
		IToken asl_comment_multiline =
			new Token(
				new TextAttribute(
					manager.getColor(IASLColorConstants.ASL_COMMENT_MULTILINE)));

		IToken asl_comment =
				new Token(
					new TextAttribute(
						manager.getColor(IASLColorConstants.ASL_COMMENT)));

		IToken asl_plan =
				new Token(
					new TextAttribute(
						manager.getColor(IASLColorConstants.ASL_PLAN)));
		
		IToken asl_init_desire =
				new Token(
					new TextAttribute(
						manager.getColor(IASLColorConstants.ASL_INIT_DESIRE)));
		
		
		IRule[] rules = new IRule[]{
				new MultiLineRule("/*", "*/", asl_comment_multiline),
				new EndOfLineRule("//", asl_comment),
				new MultiLineRule("+!", ".", asl_plan), 
				new SingleLineRule("!", ".", asl_init_desire)
		};
		

		setRules(rules);
	}
}
